#pragma once
#include <SFML\Graphics.hpp>
#include <list>
#include "ControllerBase.h"
#include "BulletFactory.h"
#include "ServerBase.h"

namespace cat
{
	// Idea: API would be a more suitable name (shorter! -> easier to use...)
	class Application
	{
	private:
		Application(void);
		~Application(void);

		// Not copyable
		Application(const Application&);
        Application& operator= (const Application&);

		static Application _instance;

		ServerBase* _server;

		cat::BulletFactory _bulletFactory;
		sf::RenderWindow* _window;
		std::list<ControllerBase*> _controllers;

	public:
		static Application& current(void);

		void menu(void);

		void registerController(ControllerBase* controller);
		std::list<ControllerBase*>::iterator getControllersIteratorBegin(void);
		std::list<ControllerBase*>::iterator getControllersIteratorEnd(void);

		BulletFactory& getBulletFactory(void);
		ServerBase& getServer(void);
		
		sf::RenderWindow& getWindow(void);
	};
}
